package com.ysd.lis.controller;

import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.WkCalcCommonDetail;
import com.ysd.lis.request.WkCalcCommonDetailRequest;
import com.ysd.lis.service.WkCalcCommonDetailService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 绩效考核-公共参数（属性值配置）
 * @author LuoXS
 * @date 2024/4/16
 * version 1.0
 */
@RestController
@RequestMapping("/wk/calc/base/detail")
public class WkCalcCommonDetailController extends BaseController {

    @Autowired
    WkCalcCommonDetailService service;

    @ApiOperation("绩效考核-额外奖励列表（分页）")
    @GetMapping("/page")
    public Result pageList(WkCalcCommonDetailRequest.PageParam pageParam) {
        return service.pageList(pageParam);
    }

    @ApiOperation("新增")
    @PostMapping("/option")
    @LogDetail(requestParam = "option", operationType = OperationType.INSERT, module = "绩效考核-公共参数明细", content = "新增", businessName = "calcBaseDetail")
    public Result option(@RequestBody WkCalcCommonDetailRequest.OptionParams params) {
        return service.option(params);
    }

    @ApiOperation("删除")
    @PostMapping("/delete")
    @LogDetail(requestParam = "delete", operationType = OperationType.DELETE, module = "绩效考核-公共参数明细", content = "删除", businessName = "calcBaseDetail")
    public Result delete(@RequestBody WkCalcCommonDetail entity) {
        return service.delete(entity);
    }
}
